str1 = "hello world and python and java and pycharm"

# 1. capitalize()：将字符串第一个字符转换成大写
# 注意：capitalize() 函数转换后，只字符串第一个字符大写，其他的字符全部小写
new_str = str1.capitalize()
print(new_str) # Hello world and python and java and pycharm

# 2. title()：字符串中每个单词首字母大写
new_str2 = str1.title()
print(new_str2) # Hello World And Python And Java And Pycharm

# 3. upper()：小写转大写
new_str3 = str1.upper()
print(new_str3) # HELLO WORLD AND PYTHON AND JAVA AND PYCHARM

# 4. lower()：大写转小写
new_str4 = new_str3.lower()
print(new_str4) # hello world and python and java and pycharm